#pragma once

static GLfloat _table_vertices[] = {
		// rrder of coordinates: x, y, s, t
        // triangle fan
         0.0f,  0.0f, 	0.5f, 0.5f, 
        -0.5f, -0.8f,   0.0f, 0.9f,  
         0.5f, -0.8f,   1.0f, 0.9f, 
         0.5f,  0.8f,   1.0f, 0.1f, 
        -0.5f,  0.8f,   0.0f, 0.1f, 
        -0.5f, -0.8f,   0.0f, 0.9f,
};

class table {
public:
	void
	binddata() {
		GLsizei stride = sizeof(GLfloat) * 4;
		glEnableVertexAttribArray(0);
		glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, stride, _table_vertices);
		
		glEnableVertexAttribArray(1);
		glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, stride, _table_vertices + 2);
	}
	
	void 
	draw() {
		glDrawArrays(GL_TRIANGLE_FAN, 0, 6);
	}
};